<template>
  <div class="cell-paiming">
    <div class="cell-paiming-main">
      <div class="cell-paiming-title">
        <span class="title">近三十天小区高发排名</span>
      </div>
      <div class="cell-paiming-list">
        <ul>
          <li v-for="(item,index) in cellPaimingData" :key="index">
            <span class="name"><i :class="'BG'+index">{{index+1}}</i><em>{{item.deptName}}</em></span>
            <span class="total">{{item.eventCount}}</span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      cellPaimingData: null
    }
  },
  mounted () {
    let url = this.$base.getUrl('countLastThirtyEvent')
    let params = {
      url: url,
      data: {}
    }
    this.$store.dispatch('postForm', params).then(res => {
      if (res.code === 0) {
        // console.log(res.result)
        this.cellPaimingData = res.result
      }
    })
  },
  methods: {},
  computed: {},
  watch: {}
}
</script>
<style lang="less">
.cell-paiming {
  width: 270px;
  background: rgba(43, 54, 72, 0.7);
  border-radius: 4px;
  /*height: 190px;*/
}

.cell-paiming-main {
  padding: 16px 20px 10px 20px;
}

.cell-paiming-title {
  height: 30px;
  position: relative;
  span.title {
    font-size: 12px;
    color: #ffffff;
    line-height: 20px;
  }
  span.time {
    font-style: normal;
    position: absolute;
    right: 0;
    line-height: 20px;
    text-align: right;
    font-size: 12px;
    color: #ffffff;
    letter-spacing: 0.4px;
  }
}

.cell-paiming-list {
  padding: 6px 0;
  li {
    color: #9facc3;
    line-height: 25px;
    background: url('/images/icons/line.png') repeat-x center center;
    letter-spacing: -5px;
    font-size: 0;
    span.name,
    span.total {
      font-size: 12px;
      letter-spacing: normal;
      vertical-align: top;
      display: inline-block;
    }
    span.name {
      background: rgba(43, 54, 72, 0.95);
      i {
        width: 15px;
        height: 15px;
        line-height: 17px;
        text-align: center;
        background: #4a90e2;
        border-radius: 2px;
        display: block;
        float: left;
        font-size: 12px;
        letter-spacing: 0.4px;
        color: rgba(0, 0, 0, 0.5);
        font-style: normal;
        margin-right: 10px;
        margin-top: 4px;
        &.BG0 {
          background: #f5a623;
        }
        &.BG1 {
          background: #50e3c2;
        }
        &.BG2 {
          background: #b8e986;
        }
      }
      em {
        font-style: normal;
        padding-right: 10px;
        display: block;
        float: left;
        line-height: 25px;
      }
    }
    span.total {
      float: right;
      background: rgba(43, 54, 72, 0.95);
      padding-left: 10px;
    }
  }
}
</style>
